//
//  ACEQuestionsTableViewCell.m
//  ACE
//
//  Created by zhangtao on 2018/8/8.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "ACEQuestionsTableViewCell.h"

@implementation ACEQuestionsTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    //ACEWidth/(690/115);
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat H = ACEWidth/(690/115);
        
        self.backgroundColor = [UIColor whiteColor];
        UIView *shadowView = [[UIView alloc]initWithFrame:CGRectMake(10, 10, ACEWidth-20, H-10)];
        shadowView.layer.cornerRadius = (H-10)/2;
        shadowView.backgroundColor = [UIColor whiteColor];
        shadowView.layer.shadowColor = lightGreen.CGColor;//shadowColor阴影颜色
        shadowView.layer.shadowOffset = CGSizeMake(0,0);//shadowOffset阴影偏移,x向右偏移4，y向下偏移4，默认(0, -3)
        shadowView.layer.shadowOpacity = 0.8;//阴影透明度，默认0
        shadowView.layer.shadowRadius = 2;//阴影半径，默认3
        
        [self addSubview:shadowView];
     
        UIImageView *imageV = [[UIImageView alloc]initWithFrame:CGRectZero];
        [shadowView addSubview:imageV];
        [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(shadowView).mas_offset(23);
            make.centerY.mas_equalTo(shadowView);
            make.width.mas_equalTo(@28);
            make.height.mas_equalTo(@29);
        }];
        
        
        _titleLab = [[UILabel alloc]initWithFrame:CGRectZero];
        [shadowView addSubview:_titleLab];
        [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(shadowView);
            make.left.mas_equalTo(imageV.mas_right).mas_offset(10);
          
        }];
        
        _titleLab.text = @"课程代码";
        _titleLab.font = [UIFont systemFontOfSize:17];
        
        imageV.image = [UIImage imageNamed:@"课程-代码"];
        
        UIImageView *rightArrow = [[UIImageView alloc]initWithFrame:CGRectZero];
        [shadowView addSubview:rightArrow];
        [rightArrow mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(shadowView).mas_offset(-25);
            make.centerY.mas_equalTo(shadowView);
            make.width.mas_equalTo(@12);
            make.height.mas_equalTo(@12);
        }];
        rightArrow.image = [UIImage imageNamed:@"greenRightArrow"];
        
        
    }
    return self;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
